import request from '../utils/request'
/**
 *获取商品详情
 * @param {String} id - 顶级类目ID
 */
export const findGoods = (id) => {
  return request('/goods', 'get', { id })
}
/**
 *
 * @param {String} id - 商品ID 传入相关推荐 不传猜你喜欢
 */
export const findRelevantGoods = ({ id, limit = 16 }) => {
  return request('/goods/relevant', 'get', { id, limit })
}
/**
 * 获取相关推荐 猜你喜欢商品
 * @param {String} id - 商品ID 传入相关推荐 不传猜你喜欢
 */
export const findGoodsHot = ({ id, limit = 3, type = 1 }) => {
  return request('/goods/hot', 'get', { id, limit, type })
}
/**
 * 查询商品评价信息 mock
 * @param {String} id - 商品ID
 */
export const findGoodsCommentInfo = (id) => {
  // return request(`/goods/${id}/evaluate`, 'get')
  // axios遇见 https开头的就不会添加baseurl
  return request(`https://mock.boxuegu.com/mock/1175/goods/${id}/evaluate`, 'get')
}
/**
 * 查询商品评价列表
 * @param {String} id - 商品ID
 */
export const findGoodsCommentList = (id, params) => {
  return request(`https://mock.boxuegu.com/mock/1175/goods/${id}/evaluate/page`, 'get', params)
}
